<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Getting Started: Serving Web Content</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script th:src="@{jquery-1.8.0.min.js}" type="text/javascript"></script>
</head>
<body>
	<div>
		认购者:<input type="text" name="user" id="user" />
		<button th:onclick="'query();'">查询利息</button>
	</div>
	<div>
		<span th:text="${interestResponse.info}"></span>
		<a id="info">11</a>
	</div>
	<%@ include th:file="/static/common/footer.jsp"%>
	<script th:inline="javascript">
		function query() {
			var user = $("#user").val();
			$.ajax({
				type : "post",
				url : "/getInterest",
				async : false,
				cache : false,
				data : {"user" : user},
				dataType : "json",
				success : function(data) {
					var interestResponse = [[${interestResponse}]];
					var info = interestResponse.info;
					alert(info);
					$("#info").html(info);
				},
				error : function(data) {
					alert("查询利息异常。");
				}

			});
		}
	</script>
</body>
</html>
